86581625d01a7224c157506195210a33cbbfe7a2,src/com/opencms/workplace/CmsPublishResource.java,CmsPublishResource,unlockResource,#CmsObject#CmsResource#,185
Before Change
// if the folder itself is locked, all subresources are unlocked by unlocking the folder
if(resource.isLocked()){
// first lock resource to set locked by to the current user
cms.lockResource(resource.getAbsolutePath(),true);
cms.unlockResource(resource.getAbsolutePath());
} else {
// need to unlock each resource
After Change
if(resource.isLocked()){
// first lock resource to set locked by to the current user
if(resource.isLockedBy() != cms.getRequestContext().currentUser().getId()){
cms.lockResource(resource.getAbsolutePath(),true);
}
cms.unlockResource(resource.getAbsolutePath());
} else {
// need to unlock each resource
Vector allFiles = cms.getFilesInFolder(resource.getAbsolutePath());
Vector allFolders = cms.getSubFolders(resource.getAbsolutePath());
// unlock the files
for(int i=0; i<allFiles.size(); i++){
CmsResource curFile = (CmsResource)allFiles.elementAt(i);
if(curFile.isLocked()){
if(resource.isLockedBy() != cms.getRequestContext().currentUser().getId()){
cms.lockResource(curFile.getAbsolutePath(),true);
}
cms.unlockResource(curFile.getAbsolutePath());
}